<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>GetHTTPHeader</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">GetHTTPHeader()</font></b></p>
<p><b>语法</b></p><blockquote>

Result$ = <font color="#3A3966"><b>GetHTTPHeader</b></font>(URL$)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>





Get the HTTP headers of the given URL. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>URL$</i></td>
<td width="90%"> 
 
The URL for the query. The URL must be fully qualified, and must include 
the "http://" or "https://" prefix. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



Returns a string containing the header lines. Each line ends with a 
<a href="../string/chr.html">Chr(10)</a> character. 
<a href="../string/stringfield.html">StringField()</a> can be used to split it into several strings. 
<br>
<br>
The content of the headers are dependent on the 
type of server and therefore their contents vary, but the header that is returned by 
that server, provides very useful information about the file, such as the date, the 
server type, the version, and more. 

 

</blockquote><p><b>备注</b></p><blockquote>

<a href="../network/initnetwork.html">InitNetwork()</a> has to be called before using this command. 

 

</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2"><font color="#3A3966">  InitNetwork</font>()

  Header$ =<font color="#3A3966"> GetHTTPHeader</font>("http://www.purebasic.com/index.php")

  <b><font color="#3A3966">Repeat</font></b>
    Index+1
    Line$ =<font color="#3A3966"> StringField</font>(Header$, Index, <font color="#924B72">#LF$</font>)
    <b><font color="#3A3966">Debug</font></b> Line$
  <b><font color="#3A3966">Until</font></b> Line$ = ""
</font></pre>



Example of returned headers: 

 

<pre><font face="Courier New, Courier, mono"size="2">  HTTP/1.1 200 OK
  Date: Fri, 21 Mar 2008 09:49:30 GMT
  Server: Apache/1.3.34 (Debian) mod_vhost_online/1.1 mod_fastcgi/2.4.2 mod_log_online/0.1
  X-Powered-By: PHP/4.4.8-1
  Content-Type: text/html
</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="receivehttpfile.html">ReceiveHTTPFile()</a>, <a href="urlencoder.html">URLEncoder()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=finishhttp.html>FinishHTTP()</a> - <a href="index.html">Http Index</a> - <a href="geturlpart.html">GetURLPart()</a> -&gt;<br><br>

</body></html>